package com.weixing.mall.provider.controller.cms;


import com.weixing.mall.base.wrapper.Result;
import com.weixing.mall.base.wrapper.ResultUtil;
import com.weixing.mall.core.support.BaseController;
import com.weixing.mall.core.support.auth.SysAuth;
import com.weixing.mall.core.support.auth.SysInfo;
import com.weixing.mall.provider.model.dto.cms.BaseSetDto;
import com.weixing.mall.provider.service.IBaseSetService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 基础设置 前端控制器
 * </p>
 *
 * @author 2020
 * @since 2020-05-28
 */
@RestController
@RequestMapping("baseset")
@Api(value = "后台:基础信息", tags = "后台:基础信息")
public class BaseSetController extends BaseController {
    @Autowired
    private IBaseSetService baseSetService;

    /**
     * 查询基础信息
     */
    @ApiOperation(value = "查询基础信息")
    @GetMapping(value = "")
    public Result selectBaseSetList(){
        return ResultUtil.success(baseSetService.selectBaseSetList());
    }

    /**
     * 更新基础信息
     */
    @ApiOperation(value = "更新基础信息")
    @PostMapping(value = "updateById")
    public Result updateById(@SysInfo SysAuth auth, @RequestBody BaseSetDto baseSetDto) {
        baseSetService.updateById(baseSetDto,auth.getUid());
        return ResultUtil.success();
    }

}
